<template>
  <div style="margin-top: 50px">
    <el-form ref="form" :model="form" label-width="150px" >
      <div style="margin-top: 20px">
        <el-form-item label="呈送部门" prop="reviewDepartment"  >
          <el-select v-model="form.reviewDepartment" placeholder="请选择">
            <el-option
              v-for="dict in dict.type.he_department_name"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value">
            </el-option>
          </el-select>
        </el-form-item>
        <div class="line" />

        <el-form-item  label="填报部门"  prop="handlingPicture">
          <el-tag>
            <dict-tag :options="dict.type.he_department_name" :value="form.reportDepartment"/>
          </el-tag>
        </el-form-item>
        <el-form-item >
          <el-button v-if="form.reportStatus=='01'" type="primary" @click.prevent.native="shangbao" plain>上报</el-button>
          <el-button v-if="form.reportStatus=='02'" type="primary" plain>已上报</el-button>
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script>
import {  getReport, delReport,updateReport } from "@/api/module/shao/shijian/report";

export default {
  name: "Report",
  inject:['reload'],
  dicts: ['he_severity_of_injury','he_department_name','he_event_severity','he_education', 'he_patient_gender', 'he_party_post', 'he_report_event_state', 'he_report_event_type', 'he_patient_age_grades', 'he_event_severity', 'he_review_status', 'he_report_status', 'he_position', 'he_event_classification', 'he_review_event_type', 'he_possibility_of_dispute', 'he_patient_involved', 'he_analyze_reports', 'he_fallback_status', 'he_occurrence_time_period', 'he_event_determinatione', 'he_situation_measures_event', 'he_patient_education_level', 'he_diagnosis_category', 'he_years_of_experience', 'he_severity_of_injury', 'he_reporting_method', 'he_patient_nursing_level', 'he_date_type', 'he_invalidation_status', 'he_patient_ethnic_group', 'he_category', 'he_handling_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 事件上报信息表格数据
      reportList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    getReport(this.$route.query.id).then(response => {
      this.form = response.data;
    });
  },
  methods: {
    shangbao() {
      this.form.reportStatus = '02'
      updateReport(this.form).then(response => {
        this.$modal.msgSuccess("上报成功");
        this.reload();
      });
    },
  }
};
</script>
